class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age
    def show (self):
        print(self.name,"的年龄是",self.age)
class function1():
    def __init__(self,color):
        self.color = color
    def show (self):
        print("这是方法1的展示")
class Student(Person):
    def __init__ (self, name, age,stunum):
        super().__init__(name,age)  #调用父类已有的属性,这里调用父类的属性时，不需要传入self参数
        self.stunum = stunum  #这里是因为父类没有，所以自己赋值

class Doctor(Person):
    def __init__ (self, name, age,worknum):
        super().__init__(name,age)  #调用父类已有的属性
        self.worknum = worknum  #这里是因为父类没有，所以自己赋值

class Son(Person,function1):
    def __init__ (self, name, age,color,gender):
        Person.__init__(self,name,age)  #这里如果是调用父类，父类不需要打括号
        function1.__init__(self,color)
        self.gender = gender
stu1=Student("小小","18","10001")
stu1.show ()
doc1=Doctor("大大","26","10012")
doc1.show ()
son1=Son("梅梅","18","红色","女")
son1.show ()
